package cn.xo68.ide.plugin.service.impl;

import cn.xo68.ide.plugin.common.PluginUtils;
import cn.xo68.ide.plugin.common.domain.ProductInfo;
import cn.xo68.ide.plugin.service.AboutUsService;
import com.intellij.ide.plugins.IdeaPluginDescriptor;

public class AboutUsServiceImpl implements AboutUsService {

    @Override
    public ProductInfo getProductInfo(){
        ProductInfo productInfo=new ProductInfo();
        IdeaPluginDescriptor ideaPluginDescriptor= PluginUtils.getPluginDescriptor();
        productInfo.setName(ideaPluginDescriptor.getName());
        productInfo.setVersion(ideaPluginDescriptor.getVersion());
        productInfo.setAuthor(ideaPluginDescriptor.getVendor());
        productInfo.setPluginId(ideaPluginDescriptor.getPluginId().getIdString());
        return productInfo;
    }
}
